class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: F = None
        self.x: D = None
        self.r: E = None
        self.z: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: F = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: B = None
        self.w: D = None
        self.t: C = None
        self.txt = txt

m = A("m")
c = B("c")
e = C("e")
j = D("j")
b = E("b")
d = F("d")

m.w = c
m.z = c
m.t = d
m.x = j
m.r = b
c.u = b
c.x = b
c.q = j
c.v = j
c.r = d
e.y = c
j.v = b
j.p = d
j.x = e
b.t = d
d.u = j
d.w = j
d.p = c
d.t = e
assert m.x.x.y.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: F = None
        self.x: D = None
        self.r: E = None
        self.z: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: F = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: B = None
        self.w: D = None
        self.t: C = None
        self.txt = txt

m = A("m")
c = B("c")
e = C("e")
j = D("j")
b = E("b")
d = F("d")

m.w = c
m.z = c
m.t = d
m.x = j
m.r = b
c.u = b
c.x = b
c.q = j
c.v = j
c.r = d
e.y = c
j.v = b
j.p = d
j.x = e
b.t = d
d.u = j
d.w = j
d.p = c
d.t = e
assert m.x.x.y.q.v.txt == "b"