class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: C = None
        self.v: F = None
        self.w: B = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: B = None
        self.txt = txt

a = A("a")
l = B("l")
n = C("n")
c = D("c")
i = E("i")
d = F("d")
m = A("m")
j = C("j")

a.y = d
a.v = d
a.x = d
a.r = j
a.w = l
l.p = d
n.w = j
n.t = j
c.y = i
c.t = l
i.r = c
i.u = d
d.s = i
d.z = l
m.y = d
m.v = d
m.x = d
m.r = j
m.w = l
j.w = n
j.t = n
assert j.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: C = None
        self.v: F = None
        self.w: B = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: B = None
        self.txt = txt

a = A("a")
l = B("l")
n = C("n")
c = D("c")
i = E("i")
d = F("d")
m = A("m")
j = C("j")

a.y = d
a.v = d
a.x = d
a.r = j
a.w = l
l.p = d
n.w = j
n.t = j
c.y = i
c.t = l
i.r = c
i.u = d
d.s = i
d.z = l
m.y = d
m.v = d
m.x = d
m.r = j
m.w = l
j.w = n
j.t = n
assert j.w.w.w.txt == "n"