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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

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

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