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

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

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

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

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

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

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

k.v = l
k.x = c
k.q = c
k.w = n
j.r = b
j.y = n
c.r = n
c.t = l
c.z = j
c.x = j
b.v = j
b.o = c
b.r = c
b.u = g
b.t = l
g.o = j
n.z = c
l.v = k
l.x = c
l.q = c
l.w = n
assert l.v.x.t.w.z.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: C = None
        self.q: C = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

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

k.v = l
k.x = c
k.q = c
k.w = n
j.r = b
j.y = n
c.r = n
c.t = l
c.z = j
c.x = j
b.v = j
b.o = c
b.r = c
b.u = g
b.t = l
g.o = j
n.z = c
l.v = k
l.x = c
l.q = c
l.w = n
assert l.v.x.t.w.z.r.z.txt == "c"