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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: C = None
        self.x: C = None
        self.txt = txt

l = A("l")
i = B("i")
a = C("a")
d = D("d")
b = E("b")
n = F("n")
h = C("h")
k = A("k")
j = D("j")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: C = None
        self.x: C = None
        self.txt = txt

l = A("l")
i = B("i")
a = C("a")
d = D("d")
b = E("b")
n = F("n")
h = C("h")
k = A("k")
j = D("j")

l.u = n
l.r = k
i.x = d
i.u = b
i.q = a
a.u = i
a.w = d
a.r = h
a.t = h
a.z = h
a.p = k
d.q = a
d.x = h
b.y = a
b.s = a
n.w = b
n.o = a
n.x = a
h.u = i
h.w = d
h.r = a
h.t = a
h.z = a
h.p = k
k.u = n
k.r = l
j.q = h
j.x = h
assert k.u.x.u.x.x.w.txt == "d"