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

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: A = None
        self.s: E = None
        self.w: B = None
        self.r: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: D = None
        self.s: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: A = None
        self.s: E = None
        self.w: B = None
        self.r: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: D = None
        self.s: A = None
        self.txt = txt

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

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