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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: B = None
        self.r: B = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: H = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: H = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: C = None
        self.v: D = None
        self.q: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: B = None
        self.o: H = None
        self.t: B = None
        self.v: A = None
        self.q: H = None
        self.w: C = None
        self.x: C = None
        self.txt = txt

h = A("h")
a = B("a")
j = C("j")
m = D("m")
k = E("k")
c = F("c")
g = G("g")
f = H("f")
b = H("b")
i = A("i")

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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: B = None
        self.r: B = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: H = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: H = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: C = None
        self.v: D = None
        self.q: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: B = None
        self.o: H = None
        self.t: B = None
        self.v: A = None
        self.q: H = None
        self.w: C = None
        self.x: C = None
        self.txt = txt

h = A("h")
a = B("a")
j = C("j")
m = D("m")
k = E("k")
c = F("c")
g = G("g")
f = H("f")
b = H("b")
i = A("i")

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