class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: D = None
        self.x: E = None
        self.s: E = None
        self.r: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: D = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: F = None
        self.z: F = None
        self.q: C = None
        self.p: D = None
        self.t: F = None
        self.txt = txt

b = A("b")
f = B("f")
g = C("g")
l = D("l")
d = E("d")
c = F("c")
m = B("m")
e = F("e")

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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: D = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: F = None
        self.z: F = None
        self.q: C = None
        self.p: D = None
        self.t: F = None
        self.txt = txt

b = A("b")
f = B("f")
g = C("g")
l = D("l")
d = E("d")
c = F("c")
m = B("m")
e = F("e")

b.y = d
b.x = d
b.s = d
b.z = l
b.r = l
f.o = d
f.u = d
f.r = l
f.x = e
g.q = c
l.s = m
d.v = l
d.p = l
d.w = m
c.y = b
c.w = e
c.z = e
c.t = e
c.q = g
c.p = l
m.o = d
m.u = d
m.r = l
m.x = c
e.y = b
e.w = c
e.z = c
e.t = c
e.q = g
e.p = l
assert d.w.x.p.s.x.txt == "c"