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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: C = None
        self.v: E = None
        self.z: F = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: F = None
        self.txt = txt

i = A("i")
f = B("f")
a = C("a")
m = D("m")
b = E("b")
g = F("g")
h = G("h")
l = H("l")
n = F("n")

i.u = h
i.y = l
f.q = b
f.v = b
f.r = b
f.p = a
f.z = g
a.s = i
m.t = n
b.q = l
b.r = f
b.t = f
b.u = a
b.o = a
b.w = m
b.p = g
g.p = h
g.w = h
g.r = f
g.v = b
g.s = b
g.y = l
g.u = i
g.z = m
h.t = a
h.u = a
h.r = m
h.s = l
h.y = b
l.o = i
l.r = n
n.p = h
n.w = h
n.r = f
n.v = b
n.s = b
n.y = l
n.u = i
n.z = m
assert g.p.s.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: C = None
        self.v: E = None
        self.z: F = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: F = None
        self.txt = txt

i = A("i")
f = B("f")
a = C("a")
m = D("m")
b = E("b")
g = F("g")
h = G("h")
l = H("l")
n = F("n")

i.u = h
i.y = l
f.q = b
f.v = b
f.r = b
f.p = a
f.z = g
a.s = i
m.t = n
b.q = l
b.r = f
b.t = f
b.u = a
b.o = a
b.w = m
b.p = g
g.p = h
g.w = h
g.r = f
g.v = b
g.s = b
g.y = l
g.u = i
g.z = m
h.t = a
h.u = a
h.r = m
h.s = l
h.y = b
l.o = i
l.r = n
n.p = h
n.w = h
n.r = f
n.v = b
n.s = b
n.y = l
n.u = i
n.z = m
assert g.p.s.o.u.txt == "h"