class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: C = None
        self.v: F = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: C = None
        self.u: C = None
        self.s: F = None
        self.t: D = None
        self.txt = txt

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

d = A("d")
j = B("j")
i = C("i")
h = D("h")
n = E("n")
f = F("f")

d.o = j
d.q = i
d.y = i
d.v = f
j.x = i
j.s = i
j.t = n
i.u = d
i.s = d
h.u = f
h.y = f
h.p = n
h.x = j
n.w = d
n.z = i
n.u = i
n.s = f
n.t = h
f.x = i
f.p = h
f.q = j
f.w = j
f.s = d
f.t = d
assert h.p.w.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: C = None
        self.v: F = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: C = None
        self.u: C = None
        self.s: F = None
        self.t: D = None
        self.txt = txt

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

d = A("d")
j = B("j")
i = C("i")
h = D("h")
n = E("n")
f = F("f")

d.o = j
d.q = i
d.y = i
d.v = f
j.x = i
j.s = i
j.t = n
i.u = d
i.s = d
h.u = f
h.y = f
h.p = n
h.x = j
n.w = d
n.z = i
n.u = i
n.s = f
n.t = h
f.x = i
f.p = h
f.q = j
f.w = j
f.s = d
f.t = d
assert h.p.w.v.x.txt == "i"