class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: E = None
        self.x: A = None
        self.v: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: B = None
        self.txt = txt

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

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

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

j.y = d
j.z = l
j.x = c
j.v = n
i.z = j
d.o = n
d.s = k
d.y = j
d.u = i
m.o = l
m.w = n
l.t = d
l.w = n
l.u = a
k.p = d
c.y = d
c.z = l
c.x = j
c.v = i
a.o = l
a.w = n
n.z = c
h.p = d
assert h.p.o.z.x.z.w.z.y.u.txt == "i"