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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: D = None
        self.u: D = None
        self.txt = txt

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

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

l = A("l")
n = B("n")
h = C("h")
g = D("g")
c = E("c")
j = F("j")
m = G("m")
f = B("f")
d = A("d")
b = C("b")

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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: D = None
        self.u: D = None
        self.txt = txt

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

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

l = A("l")
n = B("n")
h = C("h")
g = D("g")
c = E("c")
j = F("j")
m = G("m")
f = B("f")
d = A("d")
b = C("b")

l.s = n
l.y = m
l.t = m
l.w = j
l.z = j
n.o = d
h.z = g
g.q = n
g.x = b
c.s = b
c.v = g
c.u = g
j.v = c
m.u = f
m.o = c
f.o = l
d.s = n
d.y = m
d.t = m
d.w = j
d.z = j
b.z = g
assert m.o.v.q.o.z.v.txt == "c"