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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: C = None
        self.r: C = None
        self.p: F = None
        self.y: A = None
        self.x: E = None
        self.txt = txt

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

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

k = A("k")
f = B("f")
h = C("h")
d = D("d")
g = E("g")
m = F("m")
j = B("j")
c = B("c")
e = D("e")
i = E("i")

k.p = d
f.u = g
f.t = d
f.p = j
f.x = i
h.y = f
d.o = h
d.t = h
d.r = h
d.p = m
d.y = k
d.x = g
g.u = h
m.o = h
m.y = h
m.x = d
m.s = d
m.u = i
m.t = c
j.u = g
j.x = g
j.t = d
j.p = c
c.u = i
c.t = e
c.p = j
c.x = g
e.o = h
e.t = h
e.r = h
e.p = m
e.y = k
e.x = g
i.u = h
assert i.u.y.x.u.y.u.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: C = None
        self.r: C = None
        self.p: F = None
        self.y: A = None
        self.x: E = None
        self.txt = txt

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

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

k = A("k")
f = B("f")
h = C("h")
d = D("d")
g = E("g")
m = F("m")
j = B("j")
c = B("c")
e = D("e")
i = E("i")

k.p = d
f.u = g
f.t = d
f.p = j
f.x = i
h.y = f
d.o = h
d.t = h
d.r = h
d.p = m
d.y = k
d.x = g
g.u = h
m.o = h
m.y = h
m.x = d
m.s = d
m.u = i
m.t = c
j.u = g
j.x = g
j.t = d
j.p = c
c.u = i
c.t = e
c.p = j
c.x = g
e.o = h
e.t = h
e.r = h
e.p = m
e.y = k
e.x = g
i.u = h
assert i.u.y.x.u.y.u.u.y.txt == "f"