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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: I = None
        self.r: A = None
        self.z: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: I = None
        self.r: A = None
        self.z: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

h.u = c
g.v = c
n.s = b
m.t = g
m.y = b
m.u = b
m.v = l
m.w = l
m.o = k
a.t = l
a.s = c
c.s = m
c.y = m
c.t = e
c.v = a
c.u = l
c.o = n
c.w = b
k.w = m
k.v = b
k.r = h
k.z = l
l.z = a
l.q = e
b.x = h
e.t = g
e.y = b
e.u = b
e.v = l
e.w = l
e.o = k
assert h.u.w.x.u.t.y.x.txt == "h"