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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: F = None
        self.y: G = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: E = None
        self.q: E = None
        self.o: F = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: F = None
        self.y: G = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: E = None
        self.q: E = None
        self.o: F = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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