class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: H = None
        self.p: F = None
        self.q: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: G = None
        self.w: E = None
        self.o: I = None
        self.z: I = None
        self.r: A = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: C = None
        self.v: G = None
        self.r: G = None
        self.q: D = None
        self.s: C = None
        self.y: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: A = None
        self.q: G = None
        self.v: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: G = None
        self.w: E = None
        self.o: I = None
        self.z: I = None
        self.r: A = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: C = None
        self.v: G = None
        self.r: G = None
        self.q: D = None
        self.s: C = None
        self.y: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: A = None
        self.q: G = None
        self.v: H = None
        self.txt = txt

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

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