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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: D = None
        self.u: A = None
        self.s: E = None
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: F = None
        self.q: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: D = None
        self.u: A = None
        self.s: E = None
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: F = None
        self.q: A = None
        self.txt = txt

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

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

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

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