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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

l = A("l")
k = B("k")
e = C("e")
d = D("d")
i = E("i")
j = F("j")
h = D("h")
m = E("m")
c = C("c")
f = A("f")

l.x = c
l.s = f
l.w = j
k.s = l
k.t = j
k.y = d
e.q = j
d.z = j
d.y = m
d.o = k
i.w = j
j.q = f
h.z = j
h.y = m
h.o = k
m.w = j
c.q = j
f.x = e
f.s = l
f.w = j
assert d.z.q.x.q.q.s.s.w.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: A = None
        self.w: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

l = A("l")
k = B("k")
e = C("e")
d = D("d")
i = E("i")
j = F("j")
h = D("h")
m = E("m")
c = C("c")
f = A("f")

l.x = c
l.s = f
l.w = j
k.s = l
k.t = j
k.y = d
e.q = j
d.z = j
d.y = m
d.o = k
i.w = j
j.q = f
h.z = j
h.y = m
h.o = k
m.w = j
c.q = j
f.x = e
f.s = l
f.w = j
assert d.z.q.x.q.q.s.s.w.q.w.txt == "j"