class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: F = None
        self.v: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: F = None
        self.v: A = None
        self.txt = txt

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

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

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