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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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