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

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

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

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

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

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

n = A("n")
d = B("d")
i = C("i")
c = D("c")
a = E("a")
k = F("k")
l = A("l")
g = A("g")
f = B("f")

n.t = c
n.z = k
d.t = i
d.u = a
d.y = c
i.x = n
i.v = a
c.v = k
c.r = l
c.z = f
a.u = f
a.y = f
a.q = c
a.t = d
a.p = d
a.v = n
k.w = c
k.x = c
l.t = c
l.z = k
g.t = c
g.z = k
f.t = i
f.u = a
f.y = c
assert g.t.r.t.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

n = A("n")
d = B("d")
i = C("i")
c = D("c")
a = E("a")
k = F("k")
l = A("l")
g = A("g")
f = B("f")

n.t = c
n.z = k
d.t = i
d.u = a
d.y = c
i.x = n
i.v = a
c.v = k
c.r = l
c.z = f
a.u = f
a.y = f
a.q = c
a.t = d
a.p = d
a.v = n
k.w = c
k.x = c
l.t = c
l.z = k
g.t = c
g.z = k
f.t = i
f.u = a
f.y = c
assert g.t.r.t.r.z.txt == "k"