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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: D = None
        self.y: F = None
        self.t: I = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: D = None
        self.w: E = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: I = None
        self.o: E = None
        self.p: G = None
        self.y: H = None
        self.q: E = None
        self.v: H = None
        self.u: I = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: B = None
        self.u: D = None
        self.z: B = None
        self.p: E = None
        self.x: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: D = None
        self.y: F = None
        self.t: I = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: D = None
        self.w: E = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: I = None
        self.o: E = None
        self.p: G = None
        self.y: H = None
        self.q: E = None
        self.v: H = None
        self.u: I = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: B = None
        self.u: D = None
        self.z: B = None
        self.p: E = None
        self.x: C = None
        self.txt = txt

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

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

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