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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: G = None
        self.u: B = None
        self.v: G = None
        self.x: H = None
        self.w: A = None
        self.r: H = None
        self.p: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: A = None
        self.t: A = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: A = None
        self.r: C = None
        self.z: C = None
        self.o: C = None
        self.y: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: G = None
        self.u: B = None
        self.v: G = None
        self.x: H = None
        self.w: A = None
        self.r: H = None
        self.p: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: A = None
        self.t: A = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: A = None
        self.r: C = None
        self.z: C = None
        self.o: C = None
        self.y: F = None
        self.txt = txt

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

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