class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: B = None
        self.w: B = None
        self.s: D = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: D = None
        self.t: F = None
        self.u: D = None
        self.q: D = None
        self.txt = txt

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

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

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

a = A("a")
e = B("e")
d = C("d")
g = D("g")
n = E("n")
l = F("l")
b = C("b")

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: D = None
        self.t: F = None
        self.u: D = None
        self.q: D = None
        self.txt = txt

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

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

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

a = A("a")
e = B("e")
d = C("d")
g = D("g")
n = E("n")
l = F("l")
b = C("b")

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