class A:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: B = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: I = None
        self.r: H = None
        self.x: D = None
        self.p: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: H = None
        self.p: C = None
        self.t: B = None
        self.s: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: I = None
        self.o: H = None
        self.t: C = None
        self.z: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: F = None
        self.r: E = None
        self.w: H = None
        self.v: G = None
        self.p: E = None
        self.y: C = None
        self.txt = txt

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

a.p = d
a.t = b
a.v = b
b.v = l
b.o = d
b.p = d
b.r = m
b.x = i
l.w = a
i.u = m
i.w = l
f.z = i
f.o = m
f.p = l
f.t = b
f.s = k
c.r = a
c.x = m
k.x = d
k.o = m
k.t = l
k.z = i
m.q = d
m.r = d
m.x = i
d.t = f
d.r = f
d.p = f
d.q = c
d.w = m
d.v = k
d.y = l
assert a.p.v.t.w.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: B = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: I = None
        self.r: H = None
        self.x: D = None
        self.p: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: H = None
        self.p: C = None
        self.t: B = None
        self.s: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: I = None
        self.o: H = None
        self.t: C = None
        self.z: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: F = None
        self.r: E = None
        self.w: H = None
        self.v: G = None
        self.p: E = None
        self.y: C = None
        self.txt = txt

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

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