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

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

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

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

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

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

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

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

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

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

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

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

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

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

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