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

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

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

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

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

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

h = A("h")
k = B("k")
b = C("b")
n = D("n")
i = E("i")
j = F("j")
e = D("e")
c = B("c")
g = D("g")

h.p = i
k.z = j
b.v = i
b.y = i
b.r = h
b.z = n
n.y = b
n.u = k
n.t = k
n.v = h
n.o = c
i.x = b
i.q = h
i.y = k
j.o = i
j.r = g
j.w = h
j.u = b
e.y = b
e.u = c
e.t = c
e.o = c
e.v = h
c.z = j
g.y = b
g.u = c
g.t = c
g.o = c
g.v = h
assert k.z.o.y.z.o.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

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

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

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

h = A("h")
k = B("k")
b = C("b")
n = D("n")
i = E("i")
j = F("j")
e = D("e")
c = B("c")
g = D("g")

h.p = i
k.z = j
b.v = i
b.y = i
b.r = h
b.z = n
n.y = b
n.u = k
n.t = k
n.v = h
n.o = c
i.x = b
i.q = h
i.y = k
j.o = i
j.r = g
j.w = h
j.u = b
e.y = b
e.u = c
e.t = c
e.o = c
e.v = h
c.z = j
g.y = b
g.u = c
g.t = c
g.o = c
g.v = h
assert k.z.o.y.z.o.x.r.txt == "h"