class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: B = None
        self.y: A = None
        self.o: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: F = None
        self.u: A = None
        self.o: C = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: F = None
        self.u: A = None
        self.o: C = None
        self.z: A = None
        self.txt = txt

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

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

f.r = g
f.o = g
f.z = k
f.y = h
k.p = m
k.s = n
k.u = j
k.v = j
n.x = h
g.z = i
j.x = a
j.r = a
j.u = h
j.o = n
j.z = f
a.r = f
a.t = d
m.z = j
i.x = a
i.r = a
i.u = h
i.z = h
i.o = n
d.p = g
d.s = n
d.u = i
d.v = i
h.r = m
h.o = m
h.z = k
h.y = f
assert f.y.r.z.z.o.z.o.x.txt == "h"