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

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: E = None
        self.r: A = None
        self.u: A = None
        self.v: C = None
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: C = None
        self.q: D = None
        self.w: A = None
        self.txt = txt

e = A("e")
i = B("i")
b = C("b")
h = D("h")
f = E("f")
m = F("m")

e.o = h
e.z = i
e.x = m
i.q = f
b.p = h
b.v = e
b.w = i
h.z = f
h.t = f
h.r = e
h.u = e
h.v = b
h.q = b
f.s = i
f.q = e
f.t = h
f.v = h
m.z = h
m.q = h
m.p = b
m.w = e
assert m.z.t.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: B = None
        self.x: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: E = None
        self.r: A = None
        self.u: A = None
        self.v: C = None
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: C = None
        self.q: D = None
        self.w: A = None
        self.txt = txt

e = A("e")
i = B("i")
b = C("b")
h = D("h")
f = E("f")
m = F("m")

e.o = h
e.z = i
e.x = m
i.q = f
b.p = h
b.v = e
b.w = i
h.z = f
h.t = f
h.r = e
h.u = e
h.v = b
h.q = b
f.s = i
f.q = e
f.t = h
f.v = h
m.z = h
m.q = h
m.p = b
m.w = e
assert m.z.t.q.x.txt == "m"