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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: D = None
        self.t: A = None
        self.w: C = None
        self.z: G = None
        self.o: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

a = A("a")
f = B("f")
i = C("i")
l = D("l")
e = E("e")
n = F("n")
m = G("m")
j = G("j")
k = F("k")
h = D("h")

a.u = f
f.o = i
i.x = l
l.r = j
e.v = i
e.w = i
e.y = h
e.t = a
e.z = m
e.o = n
n.p = a
n.r = m
n.u = i
m.v = i
j.v = i
k.p = a
k.r = j
k.u = i
h.r = j
assert i.x.r.v.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: D = None
        self.t: A = None
        self.w: C = None
        self.z: G = None
        self.o: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

a = A("a")
f = B("f")
i = C("i")
l = D("l")
e = E("e")
n = F("n")
m = G("m")
j = G("j")
k = F("k")
h = D("h")

a.u = f
f.o = i
i.x = l
l.r = j
e.v = i
e.w = i
e.y = h
e.t = a
e.z = m
e.o = n
n.p = a
n.r = m
n.u = i
m.v = i
j.v = i
k.p = a
k.r = j
k.u = i
h.r = j
assert i.x.r.v.x.r.txt == "j"