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

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

class C:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: C = None
        self.p: C = None
        self.t: A = None
        self.w: E = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: C = None
        self.p: C = None
        self.t: A = None
        self.w: E = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

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

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

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