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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: B = None
        self.y: E = None
        self.q: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: B = None
        self.u: A = None
        self.v: D = None
        self.o: A = None
        self.txt = txt

k = A("k")
h = B("h")
c = C("c")
l = D("l")
i = E("i")
g = F("g")
b = G("b")
f = C("f")
m = F("m")

k.z = m
h.s = b
c.o = l
c.q = l
c.z = h
c.y = i
l.u = g
l.x = f
i.z = f
i.r = h
i.x = h
i.p = l
i.u = k
g.q = c
g.r = m
b.x = l
b.v = l
b.p = h
b.u = k
b.o = k
f.o = l
f.q = l
f.z = h
f.y = i
m.q = c
m.r = g
assert h.s.x.u.r.q.z.s.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: B = None
        self.y: E = None
        self.q: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: B = None
        self.u: A = None
        self.v: D = None
        self.o: A = None
        self.txt = txt

k = A("k")
h = B("h")
c = C("c")
l = D("l")
i = E("i")
g = F("g")
b = G("b")
f = C("f")
m = F("m")

k.z = m
h.s = b
c.o = l
c.q = l
c.z = h
c.y = i
l.u = g
l.x = f
i.z = f
i.r = h
i.x = h
i.p = l
i.u = k
g.q = c
g.r = m
b.x = l
b.v = l
b.p = h
b.u = k
b.o = k
f.o = l
f.q = l
f.z = h
f.y = i
m.q = c
m.r = g
assert h.s.x.u.r.q.z.s.u.z.txt == "m"