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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: D = None
        self.x: B = None
        self.z: F = None
        self.p: B = None
        self.s: D = None
        self.txt = txt

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

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

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

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

j.y = b
j.x = e
j.z = c
l.v = h
b.r = e
b.u = e
b.s = e
b.x = l
b.p = l
b.z = h
e.q = b
c.y = l
c.x = j
c.s = j
h.u = j
h.w = b
h.z = b
h.v = e
h.o = e
h.x = l
assert h.o.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: D = None
        self.z: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: D = None
        self.x: B = None
        self.z: F = None
        self.p: B = None
        self.s: D = None
        self.txt = txt

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

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

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

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

j.y = b
j.x = e
j.z = c
l.v = h
b.r = e
b.u = e
b.s = e
b.x = l
b.p = l
b.z = h
e.q = b
c.y = l
c.x = j
c.s = j
h.u = j
h.w = b
h.z = b
h.v = e
h.o = e
h.x = l
assert h.o.q.s.txt == "e"