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

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

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

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

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

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

e = A("e")
m = B("m")
k = C("k")
i = D("i")
b = E("b")
j = F("j")

e.q = j
e.x = j
e.p = j
m.q = e
k.r = i
k.w = b
i.y = e
i.x = k
b.p = j
b.t = i
b.x = m
j.v = e
j.t = k
assert b.x.q.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: F = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

e = A("e")
m = B("m")
k = C("k")
i = D("i")
b = E("b")
j = F("j")

e.q = j
e.x = j
e.p = j
m.q = e
k.r = i
k.w = b
i.y = e
i.x = k
b.p = j
b.t = i
b.x = m
j.v = e
j.t = k
assert b.x.q.q.v.txt == "e"