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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: G = None
        self.v: F = None
        self.p: E = None
        self.u: D = None
        self.txt = txt

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

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

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

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

e.t = m
e.u = m
e.v = h
e.p = n
e.z = g
m.w = k
m.z = h
f.x = m
f.v = h
g.o = a
g.u = a
g.q = h
g.v = k
g.p = c
c.r = n
c.u = k
c.v = m
c.t = h
c.p = e
c.o = a
c.y = a
k.p = m
k.o = f
k.q = h
h.o = k
a.o = g
a.u = g
a.q = h
a.v = k
a.p = c
n.r = c
n.u = k
n.v = m
n.t = h
n.p = e
n.o = g
n.y = a
assert n.u.p.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: G = None
        self.u: B = None
        self.p: E = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: G = None
        self.v: F = None
        self.p: E = None
        self.u: D = None
        self.txt = txt

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

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

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

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

e.t = m
e.u = m
e.v = h
e.p = n
e.z = g
m.w = k
m.z = h
f.x = m
f.v = h
g.o = a
g.u = a
g.q = h
g.v = k
g.p = c
c.r = n
c.u = k
c.v = m
c.t = h
c.p = e
c.o = a
c.y = a
k.p = m
k.o = f
k.q = h
h.o = k
a.o = g
a.u = g
a.q = h
a.v = k
a.p = c
n.r = c
n.u = k
n.v = m
n.t = h
n.p = e
n.o = g
n.y = a
assert n.u.p.w.o.txt == "f"