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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

d.u = k
d.t = b
d.z = b
n.o = k
e.u = n
e.z = c
m.x = n
m.w = n
m.s = c
m.t = d
i.z = b
g.q = i
g.y = d
g.s = d
g.v = n
g.u = k
k.q = i
k.y = c
k.s = c
k.v = n
k.u = g
c.u = g
c.t = b
c.z = m
b.x = n
b.w = n
b.s = d
b.t = c
assert g.q.z.w.o.y.u.v.o.v.txt == "n"