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

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: F = None
        self.v: D = None
        self.txt = txt

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

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

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

f.u = j
f.o = h
f.v = h
k.z = b
k.y = f
b.y = g
g.s = n
g.q = h
g.v = a
n.q = b
h.s = a
j.q = b
a.s = j
a.q = h
a.v = g
c.z = b
c.y = f
assert n.q.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: F = None
        self.v: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: F = None
        self.v: D = None
        self.txt = txt

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

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

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

f.u = j
f.o = h
f.v = h
k.z = b
k.y = f
b.y = g
g.s = n
g.q = h
g.v = a
n.q = b
h.s = a
j.q = b
a.s = j
a.q = h
a.v = g
c.z = b
c.y = f
assert n.q.y.v.txt == "a"