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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: E = None
        self.t: F = None
        self.v: G = None
        self.z: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: A = None
        self.s: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: E = None
        self.t: F = None
        self.v: G = None
        self.z: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: A = None
        self.s: B = None
        self.txt = txt

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

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

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

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