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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: A = None
        self.x: A = None
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: F = None
        self.r: B = None
        self.o: C = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: G = None
        self.y: G = None
        self.u: D = None
        self.x: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: A = None
        self.x: A = None
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: F = None
        self.r: B = None
        self.o: C = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: G = None
        self.y: G = None
        self.u: D = None
        self.x: G = None
        self.txt = txt

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

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

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