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

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: E = None
        self.t: E = None
        self.o: E = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: D = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: E = None
        self.t: E = None
        self.o: E = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: D = None
        self.u: F = None
        self.txt = txt

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

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

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