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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: G = None
        self.q: F = None
        self.w: F = None
        self.t: C = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: H = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: H = None
        self.x: E = None
        self.s: E = None
        self.w: C = None
        self.r: H = None
        self.y: D = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: A = None
        self.t: D = None
        self.o: F = None
        self.q: A = None
        self.p: H = None
        self.w: F = None
        self.s: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: G = None
        self.q: F = None
        self.w: F = None
        self.t: C = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: H = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: H = None
        self.x: E = None
        self.s: E = None
        self.w: C = None
        self.r: H = None
        self.y: D = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: A = None
        self.t: D = None
        self.o: F = None
        self.q: A = None
        self.p: H = None
        self.w: F = None
        self.s: F = None
        self.txt = txt

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

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

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