class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: E = None
        self.w: G = None
        self.t: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: H = None
        self.x: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: G = None
        self.txt = txt

i = A("i")
c = B("c")
d = C("d")
k = D("k")
l = E("l")
a = F("a")
m = G("m")
f = H("f")
e = I("e")

i.r = m
i.w = m
i.y = l
i.t = a
c.u = d
d.u = m
d.r = k
d.x = a
k.o = a
k.r = f
k.x = e
l.s = k
l.y = d
a.q = k
m.x = c
f.r = d
e.z = c
e.o = m
assert d.u.x.u.u.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: E = None
        self.w: G = None
        self.t: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: H = None
        self.x: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: G = None
        self.txt = txt

i = A("i")
c = B("c")
d = C("d")
k = D("k")
l = E("l")
a = F("a")
m = G("m")
f = H("f")
e = I("e")

i.r = m
i.w = m
i.y = l
i.t = a
c.u = d
d.u = m
d.r = k
d.x = a
k.o = a
k.r = f
k.x = e
l.s = k
l.y = d
a.q = k
m.x = c
f.r = d
e.z = c
e.o = m
assert d.u.x.u.u.x.u.txt == "d"