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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: B = None
        self.y: G = None
        self.o: G = None
        self.s: A = None
        self.z: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: A = None
        self.z: F = None
        self.o: A = None
        self.v: F = None
        self.y: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: G = None
        self.z: D = None
        self.x: C = None
        self.txt = txt

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

c = A("c")
j = B("j")
d = C("d")
l = D("l")
m = E("m")
g = F("g")
f = G("f")
n = B("n")
h = G("h")
a = A("a")

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: B = None
        self.y: G = None
        self.o: G = None
        self.s: A = None
        self.z: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: A = None
        self.z: F = None
        self.o: A = None
        self.v: F = None
        self.y: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: G = None
        self.z: D = None
        self.x: C = None
        self.txt = txt

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

c = A("c")
j = B("j")
d = C("d")
l = D("l")
m = E("m")
g = F("g")
f = G("f")
n = B("n")
h = G("h")
a = A("a")

c.t = g
j.r = a
j.s = a
j.u = n
j.z = n
j.y = h
j.o = f
d.w = m
d.y = m
d.q = c
d.z = g
d.v = g
d.o = a
l.x = d
l.t = h
l.q = a
m.s = j
g.p = h
g.s = h
g.z = l
g.x = d
f.q = l
f.v = j
f.y = m
f.u = m
f.s = m
f.r = a
n.r = c
n.u = j
n.z = j
n.y = h
n.o = f
n.s = a
h.q = l
h.v = n
h.y = m
h.u = m
h.s = m
h.r = c
a.t = g
assert n.r.t.s.txt == "h"