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

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

class C:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: E = None
        self.x: B = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: E = None
        self.x: B = None
        self.r: B = None
        self.txt = txt

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

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

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

i.u = a
a.s = l
a.t = m
a.v = m
a.u = m
l.p = h
m.w = i
m.y = f
m.x = a
m.r = a
f.p = m
n.z = i
n.s = d
n.q = m
n.p = a
j.p = m
h.p = l
d.z = i
d.s = n
d.q = m
d.p = a
assert i.u.u.x.s.p.p.txt == "l"