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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: E = None
        self.x: C = None
        self.p: C = None
        self.t: D = None
        self.y: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

a.v = j
j.v = b
j.x = b
j.y = h
k.z = h
k.u = h
k.y = a
k.v = a
g.w = n
g.v = n
g.x = k
g.p = k
g.y = k
g.t = h
l.q = i
b.u = l
i.v = b
i.x = b
i.y = g
e.q = j
h.w = n
h.v = l
h.x = k
h.p = k
h.y = k
h.t = g
n.q = j
assert b.u.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: E = None
        self.x: C = None
        self.p: C = None
        self.t: D = None
        self.y: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

a.v = j
j.v = b
j.x = b
j.y = h
k.z = h
k.u = h
k.y = a
k.v = a
g.w = n
g.v = n
g.x = k
g.p = k
g.y = k
g.t = h
l.q = i
b.u = l
i.v = b
i.x = b
i.y = g
e.q = j
h.w = n
h.v = l
h.x = k
h.p = k
h.y = k
h.t = g
n.q = j
assert b.u.q.v.txt == "b"