class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: D = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: G = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: C = None
        self.w: A = None
        self.p: C = None
        self.s: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: A = None
        self.z: B = None
        self.o: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: C = None
        self.x: F = None
        self.r: D = None
        self.o: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: G = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: C = None
        self.w: A = None
        self.p: C = None
        self.s: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: A = None
        self.z: B = None
        self.o: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: C = None
        self.x: F = None
        self.r: D = None
        self.o: A = None
        self.txt = txt

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

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