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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: C = None
        self.s: F = None
        self.r: D = None
        self.txt = txt

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

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

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

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

k = A("k")
a = B("a")
n = C("n")
d = D("d")
h = E("h")
g = F("g")
e = A("e")
c = E("c")

k.o = d
k.v = g
k.z = n
k.y = e
a.q = c
a.v = n
a.s = g
a.r = d
n.t = c
d.s = a
d.t = e
h.u = a
h.y = c
g.x = n
e.o = d
e.v = g
e.z = n
e.y = k
c.u = a
c.y = h
assert n.t.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: F = None
        self.z: C = None
        self.y: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: C = None
        self.s: F = None
        self.r: D = None
        self.txt = txt

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

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

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

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

k = A("k")
a = B("a")
n = C("n")
d = D("d")
h = E("h")
g = F("g")
e = A("e")
c = E("c")

k.o = d
k.v = g
k.z = n
k.y = e
a.q = c
a.v = n
a.s = g
a.r = d
n.t = c
d.s = a
d.t = e
h.u = a
h.y = c
g.x = n
e.o = d
e.v = g
e.z = n
e.y = k
c.u = a
c.y = h
assert n.t.y.y.y.txt == "h"