class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: F = None
        self.v: D = None
        self.q: B = None
        self.u: F = None
        self.t: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: B = None
        self.y: C = None
        self.p: G = None
        self.t: C = None
        self.z: D = None
        self.o: B = None
        self.txt = txt

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

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

k = A("k")
f = B("f")
d = C("d")
c = D("c")
l = E("l")
j = F("j")
h = G("h")
m = G("m")

k.o = c
k.v = c
k.t = c
k.r = j
k.u = j
k.q = f
f.q = l
f.v = l
d.p = c
d.u = k
d.x = k
c.o = f
c.z = m
c.w = l
l.r = k
l.u = f
l.o = f
l.y = d
l.t = d
l.p = h
l.z = c
j.t = c
j.v = c
j.u = k
j.z = m
h.v = f
h.w = m
m.v = f
m.w = h
assert k.u.v.z.v.v.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: F = None
        self.v: D = None
        self.q: B = None
        self.u: F = None
        self.t: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: B = None
        self.y: C = None
        self.p: G = None
        self.t: C = None
        self.z: D = None
        self.o: B = None
        self.txt = txt

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

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

k = A("k")
f = B("f")
d = C("d")
c = D("c")
l = E("l")
j = F("j")
h = G("h")
m = G("m")

k.o = c
k.v = c
k.t = c
k.r = j
k.u = j
k.q = f
f.q = l
f.v = l
d.p = c
d.u = k
d.x = k
c.o = f
c.z = m
c.w = l
l.r = k
l.u = f
l.o = f
l.y = d
l.t = d
l.p = h
l.z = c
j.t = c
j.v = c
j.u = k
j.z = m
h.v = f
h.w = m
m.v = f
m.w = h
assert k.u.v.z.v.v.p.v.txt == "f"