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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: D = None
        self.s: B = None
        self.v: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: G = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: E = None
        self.y: D = None
        self.r: C = None
        self.o: E = None
        self.x: D = None
        self.txt = txt

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

n = A("n")
b = B("b")
g = C("g")
d = D("d")
e = E("e")
f = F("f")
l = G("l")
c = D("c")

n.v = g
b.r = f
g.x = b
g.s = b
g.t = c
g.v = l
d.p = n
e.s = c
e.x = l
e.w = f
f.w = g
f.r = g
f.z = e
f.o = e
f.y = d
f.x = c
l.z = n
l.t = n
l.x = f
l.u = e
l.w = e
l.o = b
l.v = d
c.p = n
assert l.v.p.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: D = None
        self.s: B = None
        self.v: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: G = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: E = None
        self.y: D = None
        self.r: C = None
        self.o: E = None
        self.x: D = None
        self.txt = txt

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

n = A("n")
b = B("b")
g = C("g")
d = D("d")
e = E("e")
f = F("f")
l = G("l")
c = D("c")

n.v = g
b.r = f
g.x = b
g.s = b
g.t = c
g.v = l
d.p = n
e.s = c
e.x = l
e.w = f
f.w = g
f.r = g
f.z = e
f.o = e
f.y = d
f.x = c
l.z = n
l.t = n
l.x = f
l.u = e
l.w = e
l.o = b
l.v = d
c.p = n
assert l.v.p.v.v.txt == "l"