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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: C = None
        self.v: B = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

b = A("b")
f = B("f")
c = C("c")
a = D("a")
m = E("m")
i = F("i")
d = G("d")
k = B("k")
g = E("g")
n = F("n")

b.v = f
b.u = c
b.q = i
f.x = m
f.z = n
f.y = a
f.p = g
f.u = k
c.s = k
c.t = k
c.w = b
c.o = b
c.r = a
a.t = b
m.x = k
i.s = c
i.x = c
i.v = f
i.u = b
d.p = m
k.x = g
k.z = n
k.y = a
k.p = m
k.u = f
g.x = k
n.s = c
n.x = c
n.v = k
n.u = b
assert i.u.u.w.u.r.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: C = None
        self.q: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: C = None
        self.v: B = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

b = A("b")
f = B("f")
c = C("c")
a = D("a")
m = E("m")
i = F("i")
d = G("d")
k = B("k")
g = E("g")
n = F("n")

b.v = f
b.u = c
b.q = i
f.x = m
f.z = n
f.y = a
f.p = g
f.u = k
c.s = k
c.t = k
c.w = b
c.o = b
c.r = a
a.t = b
m.x = k
i.s = c
i.x = c
i.v = f
i.u = b
d.p = m
k.x = g
k.z = n
k.y = a
k.p = m
k.u = f
g.x = k
n.s = c
n.x = c
n.v = k
n.u = b
assert i.u.u.w.u.r.t.q.txt == "i"