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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: H = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

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

j = A("j")
d = B("d")
a = C("a")
n = D("n")
h = E("h")
b = F("b")
i = G("i")
c = H("c")
g = I("g")
l = G("l")

j.p = n
d.y = a
d.s = c
d.r = h
a.u = d
n.w = a
n.x = a
n.t = c
n.r = g
h.w = i
h.y = i
h.r = a
h.q = a
h.z = c
h.v = g
h.o = g
h.p = g
h.s = b
b.x = h
b.v = c
i.o = c
c.t = j
g.q = c
l.o = c
assert i.o.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: H = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

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

j = A("j")
d = B("d")
a = C("a")
n = D("n")
h = E("h")
b = F("b")
i = G("i")
c = H("c")
g = I("g")
l = G("l")

j.p = n
d.y = a
d.s = c
d.r = h
a.u = d
n.w = a
n.x = a
n.t = c
n.r = g
h.w = i
h.y = i
h.r = a
h.q = a
h.z = c
h.v = g
h.o = g
h.p = g
h.s = b
b.x = h
b.v = c
i.o = c
c.t = j
g.q = c
l.o = c
assert i.o.t.p.txt == "n"