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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: D = None
        self.s: C = None
        self.o: A = None
        self.z: F = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: E = None
        self.r: D = None
        self.v: D = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: D = None
        self.s: C = None
        self.o: A = None
        self.z: F = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: E = None
        self.r: D = None
        self.v: D = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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