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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

d = A("d")
e = B("e")
j = C("j")
m = D("m")
g = E("g")
l = F("l")
f = G("f")
i = H("i")
b = I("b")

d.r = b
e.o = b
j.z = g
j.u = i
m.z = i
g.r = d
l.v = e
l.u = d
f.u = b
i.v = m
i.t = g
b.t = m
assert j.u.t.r.r.t.z.v.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

d = A("d")
e = B("e")
j = C("j")
m = D("m")
g = E("g")
l = F("l")
f = G("f")
i = H("i")
b = I("b")

d.r = b
e.o = b
j.z = g
j.u = i
m.z = i
g.r = d
l.v = e
l.u = d
f.u = b
i.v = m
i.t = g
b.t = m
assert j.u.t.r.r.t.z.v.z.v.txt == "m"