class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.t: F = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: A = None
        self.y: E = None
        self.q: D = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: D = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: D = None
        self.s: A = None
        self.w: B = None
        self.txt = txt

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

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

a = A("a")
g = B("g")
h = C("h")
l = D("l")
n = E("n")
m = F("m")
i = G("i")
c = E("c")
j = D("j")

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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: A = None
        self.y: E = None
        self.q: D = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: D = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: D = None
        self.s: A = None
        self.w: B = None
        self.txt = txt

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

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

a = A("a")
g = B("g")
h = C("h")
l = D("l")
n = E("n")
m = F("m")
i = G("i")
c = E("c")
j = D("j")

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