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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: C = None
        self.v: H = None
        self.o: E = None
        self.u: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: A = None
        self.r: I = None
        self.q: B = None
        self.p: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: C = None
        self.v: H = None
        self.o: E = None
        self.u: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: A = None
        self.r: I = None
        self.q: B = None
        self.p: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

d.u = i
d.v = n
g.x = d
g.u = d
g.q = e
g.v = i
g.o = a
e.w = l
e.s = l
e.v = n
e.q = k
k.z = e
k.y = b
k.r = l
k.v = l
k.p = d
a.p = n
a.w = e
n.t = i
b.x = d
b.v = d
b.p = d
b.r = l
b.q = g
i.y = n
i.u = n
i.o = d
l.y = g
assert k.z.w.y.x.u.txt == "i"