class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: B = None
        self.z: D = None
        self.q: F = None
        self.p: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: I = None
        self.o: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.x: D = None
        self.q: C = None
        self.v: I = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: I = None
        self.o: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.x: D = None
        self.q: C = None
        self.v: I = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

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