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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: C = None
        self.o: B = None
        self.x: D = None
        self.txt = txt

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

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

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

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

l = A("l")
m = B("m")
k = C("k")
b = D("b")
a = E("a")
f = F("f")
h = E("h")
j = B("j")
i = A("i")
e = E("e")

l.u = i
m.q = k
m.r = k
m.o = j
m.x = b
k.s = h
k.z = i
k.p = j
k.w = b
b.x = j
b.y = j
b.s = a
b.p = m
a.v = b
a.s = f
a.p = e
f.w = b
f.y = b
h.v = b
h.s = f
h.p = e
j.q = k
j.r = k
j.o = m
j.x = b
i.u = l
e.v = b
e.s = f
e.p = a
assert m.q.p.o.q.p.o.x.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: C = None
        self.o: B = None
        self.x: D = None
        self.txt = txt

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

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

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

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

l = A("l")
m = B("m")
k = C("k")
b = D("b")
a = E("a")
f = F("f")
h = E("h")
j = B("j")
i = A("i")
e = E("e")

l.u = i
m.q = k
m.r = k
m.o = j
m.x = b
k.s = h
k.z = i
k.p = j
k.w = b
b.x = j
b.y = j
b.s = a
b.p = m
a.v = b
a.s = f
a.p = e
f.w = b
f.y = b
h.v = b
h.s = f
h.p = e
j.q = k
j.r = k
j.o = m
j.x = b
i.u = l
e.v = b
e.s = f
e.p = a
assert m.q.p.o.q.p.o.x.y.q.txt == "k"