class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: C = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: D = None
        self.y: F = None
        self.v: B = None
        self.x: D = None
        self.p: D = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: D = None
        self.u: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: D = None
        self.y: F = None
        self.v: B = None
        self.x: D = None
        self.p: D = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: D = None
        self.u: A = None
        self.txt = txt

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

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

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