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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: D = None
        self.r: D = None
        self.x: D = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: D = None
        self.r: D = None
        self.x: D = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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