class A:
    def __init__(self, txt: str):
        self.r: C = 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.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: C = None
        self.o: B = None
        self.x: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: C = None
        self.s: I = None
        self.q: I = None
        self.v: B = None
        self.r: E = None
        self.txt = txt

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

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

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

d.r = n
b.o = l
n.v = b
h.q = b
h.o = b
h.z = n
h.x = j
m.x = e
k.t = j
k.w = e
e.u = j
e.p = n
e.s = l
e.q = l
e.v = b
e.r = m
j.p = k
j.x = d
l.t = n
assert l.t.v.o.t.v.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = 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.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: C = None
        self.o: B = None
        self.x: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: C = None
        self.s: I = None
        self.q: I = None
        self.v: B = None
        self.r: E = None
        self.txt = txt

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

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

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

d.r = n
b.o = l
n.v = b
h.q = b
h.o = b
h.z = n
h.x = j
m.x = e
k.t = j
k.w = e
e.u = j
e.p = n
e.s = l
e.q = l
e.v = b
e.r = m
j.p = k
j.x = d
l.t = n
assert l.t.v.o.t.v.o.t.txt == "n"