class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: E = None
        self.r: E = None
        self.z: F = None
        self.v: F = None
        self.q: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: F = None
        self.q: B = None
        self.z: F = None
        self.txt = txt

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

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

g.o = f
g.x = b
g.r = b
g.q = b
g.z = n
g.v = n
i.v = k
i.y = n
i.r = g
i.q = g
j.y = g
j.r = f
j.s = b
k.y = f
k.v = g
k.x = g
b.x = g
b.u = n
b.z = n
b.q = i
n.s = i
n.t = g
e.y = g
e.r = k
e.s = b
f.y = k
f.v = g
f.x = g
assert b.z.t.q.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: E = None
        self.r: E = None
        self.z: F = None
        self.v: F = None
        self.q: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: F = None
        self.q: B = None
        self.z: F = None
        self.txt = txt

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

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

g.o = f
g.x = b
g.r = b
g.q = b
g.z = n
g.v = n
i.v = k
i.y = n
i.r = g
i.q = g
j.y = g
j.r = f
j.s = b
k.y = f
k.v = g
k.x = g
b.x = g
b.u = n
b.z = n
b.q = i
n.s = i
n.t = g
e.y = g
e.r = k
e.s = b
f.y = k
f.v = g
f.x = g
assert b.z.t.q.q.v.txt == "k"