class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: D = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

d = A("d")
a = B("a")
b = C("b")
l = D("l")
i = E("i")
j = F("j")
k = C("k")

d.o = l
d.s = l
d.w = l
a.x = d
a.p = d
a.t = d
a.z = l
b.r = j
b.q = i
b.z = i
b.p = i
b.y = k
l.y = j
l.w = a
l.x = a
i.q = k
i.s = a
i.z = a
j.u = i
j.p = a
k.r = j
k.q = i
k.z = i
k.p = i
k.y = b
assert d.w.y.u.q.r.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: D = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

d = A("d")
a = B("a")
b = C("b")
l = D("l")
i = E("i")
j = F("j")
k = C("k")

d.o = l
d.s = l
d.w = l
a.x = d
a.p = d
a.t = d
a.z = l
b.r = j
b.q = i
b.z = i
b.p = i
b.y = k
l.y = j
l.w = a
l.x = a
i.q = k
i.s = a
i.z = a
j.u = i
j.p = a
k.r = j
k.q = i
k.z = i
k.p = i
k.y = b
assert d.w.y.u.q.r.txt == "j"