class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: D = None
        self.w: E = None
        self.v: H = None
        self.r: D = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.t: G = None
        self.x: A = None
        self.o: C = None
        self.q: G = None
        self.r: F = None
        self.u: D = None
        self.y: F = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: H = None
        self.t: C = None
        self.p: A = None
        self.r: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: I = None
        self.w: H = None
        self.v: C = None
        self.x: B = None
        self.p: A = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.s: D = None
        self.r: I = None
        self.z: D = None
        self.q: A = None
        self.o: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.t: G = None
        self.x: A = None
        self.o: C = None
        self.q: G = None
        self.r: F = None
        self.u: D = None
        self.y: F = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: H = None
        self.t: C = None
        self.p: A = None
        self.r: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: I = None
        self.w: H = None
        self.v: C = None
        self.x: B = None
        self.p: A = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.s: D = None
        self.r: I = None
        self.z: D = None
        self.q: A = None
        self.o: E = None
        self.txt = txt

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

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

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