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

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

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

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

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

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

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

n.z = h
l.s = j
l.x = j
b.q = l
h.s = l
j.v = c
j.t = l
j.q = l
j.z = h
j.o = n
j.w = b
c.z = h
c.v = b
c.s = l
assert b.q.s.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

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

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

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

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

n.z = h
l.s = j
l.x = j
b.q = l
h.s = l
j.v = c
j.t = l
j.q = l
j.z = h
j.o = n
j.w = b
c.z = h
c.v = b
c.s = l
assert b.q.s.q.x.txt == "j"