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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: E = None
        self.o: D = None
        self.x: A = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: A = None
        self.o: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: A = None
        self.o: C = None
        self.t: A = None
        self.w: G = None
        self.txt = txt

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

k = A("k")
c = B("c")
b = C("b")
h = D("h")
d = E("d")
m = F("m")
n = G("n")
f = E("f")
a = B("a")

k.z = b
c.y = f
c.u = f
c.o = h
c.s = h
c.x = k
b.w = n
b.y = k
b.o = k
h.q = d
h.y = a
d.o = n
d.s = f
d.w = k
m.z = h
m.v = k
m.t = k
m.o = b
m.w = n
n.r = h
n.o = h
n.w = k
n.t = k
n.z = f
n.q = d
n.s = a
f.o = n
f.s = d
f.w = k
a.y = d
a.u = f
a.o = h
a.s = h
a.x = k
assert d.o.s.y.o.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: E = None
        self.o: D = None
        self.x: A = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: A = None
        self.o: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: A = None
        self.o: C = None
        self.t: A = None
        self.w: G = None
        self.txt = txt

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

k = A("k")
c = B("c")
b = C("b")
h = D("h")
d = E("d")
m = F("m")
n = G("n")
f = E("f")
a = B("a")

k.z = b
c.y = f
c.u = f
c.o = h
c.s = h
c.x = k
b.w = n
b.y = k
b.o = k
h.q = d
h.y = a
d.o = n
d.s = f
d.w = k
m.z = h
m.v = k
m.t = k
m.o = b
m.w = n
n.r = h
n.o = h
n.w = k
n.t = k
n.z = f
n.q = d
n.s = a
f.o = n
f.s = d
f.w = k
a.y = d
a.u = f
a.o = h
a.s = h
a.x = k
assert d.o.s.y.o.s.o.txt == "h"