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

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

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

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

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

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

a = A("a")
b = B("b")
k = C("k")
j = D("j")
i = E("i")
c = F("c")
f = D("f")
l = C("l")
g = A("g")

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

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

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

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

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

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

a = A("a")
b = B("b")
k = C("k")
j = D("j")
i = E("i")
c = F("c")
f = D("f")
l = C("l")
g = A("g")

a.v = b
b.t = j
b.v = l
b.o = l
b.r = k
b.p = g
b.q = a
k.s = c
k.t = l
k.r = a
j.v = l
j.z = f
j.t = b
i.o = b
i.x = c
i.w = f
i.r = j
c.r = l
f.v = l
f.z = j
f.t = b
l.s = c
l.t = k
l.r = g
g.v = b
assert f.v.r.v.q.v.o.r.v.v.txt == "l"