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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: D = None
        self.s: H = None
        self.r: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: I = None
        self.q: C = None
        self.u: C = None
        self.r: D = None
        self.w: E = None
        self.p: C = None
        self.x: I = None
        self.y: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: A = None
        self.w: B = None
        self.o: E = None
        self.txt = txt

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

b.p = j
k.p = i
k.s = i
k.w = n
k.o = n
k.y = j
k.t = j
f.p = j
f.w = i
f.s = c
f.r = c
i.w = k
n.t = k
n.s = k
n.u = j
n.p = b
d.s = m
d.x = m
d.q = f
d.u = f
d.p = f
d.r = i
d.w = n
d.y = b
j.t = k
c.o = b
c.r = j
c.w = j
c.x = j
m.y = i
m.u = b
m.w = k
m.o = n
assert b.p.t.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: D = None
        self.s: H = None
        self.r: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: I = None
        self.q: C = None
        self.u: C = None
        self.r: D = None
        self.w: E = None
        self.p: C = None
        self.x: I = None
        self.y: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: A = None
        self.w: B = None
        self.o: E = None
        self.txt = txt

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

b.p = j
k.p = i
k.s = i
k.w = n
k.o = n
k.y = j
k.t = j
f.p = j
f.w = i
f.s = c
f.r = c
i.w = k
n.t = k
n.s = k
n.u = j
n.p = b
d.s = m
d.x = m
d.q = f
d.u = f
d.p = f
d.r = i
d.w = n
d.y = b
j.t = k
c.o = b
c.r = j
c.w = j
c.x = j
m.y = i
m.u = b
m.w = k
m.o = n
assert b.p.t.y.t.txt == "k"