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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: H = None
        self.z: F = None
        self.q: A = None
        self.p: I = None
        self.o: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.z: F = None
        self.y: F = None
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: G = None
        self.s: G = None
        self.q: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: B = None
        self.q: C = None
        self.txt = txt

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

d.p = e
d.w = j
c.p = n
c.v = k
k.w = m
k.z = m
k.v = j
k.q = d
k.p = e
k.o = e
n.w = j
b.r = e
b.z = m
b.y = m
b.v = c
m.r = b
m.u = l
m.s = l
m.q = k
l.u = e
l.o = m
l.w = m
j.z = e
e.x = k
e.q = k
e.r = c
assert n.w.z.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: I = None
        self.w: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: H = None
        self.z: F = None
        self.q: A = None
        self.p: I = None
        self.o: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.z: F = None
        self.y: F = None
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: G = None
        self.s: G = None
        self.q: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: B = None
        self.q: C = None
        self.txt = txt

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

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