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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: A = None
        self.o: E = None
        self.txt = txt

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

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

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

e.s = j
g.y = c
g.r = e
h.q = d
h.w = d
l.q = e
l.x = e
l.o = d
d.y = e
d.q = h
d.u = c
d.r = c
d.s = j
f.x = g
f.u = h
f.w = l
f.y = e
f.o = k
c.y = e
c.q = h
c.s = h
c.u = d
c.r = d
k.q = e
k.x = e
k.o = c
j.q = d
j.w = d
assert j.w.y.s.w.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: A = None
        self.o: E = None
        self.txt = txt

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

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

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

e.s = j
g.y = c
g.r = e
h.q = d
h.w = d
l.q = e
l.x = e
l.o = d
d.y = e
d.q = h
d.u = c
d.r = c
d.s = j
f.x = g
f.u = h
f.w = l
f.y = e
f.o = k
c.y = e
c.q = h
c.s = h
c.u = d
c.r = d
k.q = e
k.x = e
k.o = c
j.q = d
j.w = d
assert j.w.y.s.w.q.q.txt == "d"