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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: A = None
        self.s: F = None
        self.v: B = None
        self.y: E = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: C = None
        self.txt = txt

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

a = A("a")
n = B("n")
d = C("d")
l = D("l")
i = E("i")
m = F("m")
j = C("j")
g = F("g")
e = A("e")
b = B("b")

a.s = i
n.v = l
n.q = g
d.y = l
d.q = g
l.p = i
l.y = i
l.z = e
l.s = m
l.v = n
l.r = j
i.s = l
i.y = d
m.y = n
m.o = e
m.p = b
m.w = l
m.q = i
m.s = j
j.y = l
j.q = m
g.y = b
g.p = b
g.o = e
g.w = l
g.q = i
g.s = j
e.s = i
b.v = l
b.q = m
assert b.q.o.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: A = None
        self.s: F = None
        self.v: B = None
        self.y: E = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: C = None
        self.txt = txt

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

a = A("a")
n = B("n")
d = C("d")
l = D("l")
i = E("i")
m = F("m")
j = C("j")
g = F("g")
e = A("e")
b = B("b")

a.s = i
n.v = l
n.q = g
d.y = l
d.q = g
l.p = i
l.y = i
l.z = e
l.s = m
l.v = n
l.r = j
i.s = l
i.y = d
m.y = n
m.o = e
m.p = b
m.w = l
m.q = i
m.s = j
j.y = l
j.q = m
g.y = b
g.p = b
g.o = e
g.w = l
g.q = i
g.s = j
e.s = i
b.v = l
b.q = m
assert b.q.o.s.y.txt == "d"