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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: B = None
        self.x: B = None
        self.txt = txt

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

j = A("j")
i = B("i")
k = C("k")
f = D("f")
n = E("n")
l = F("l")
g = C("g")
a = A("a")

j.s = k
j.t = a
i.p = f
i.q = l
k.y = n
f.w = g
f.o = l
f.q = k
n.o = k
n.r = i
n.x = i
l.u = n
l.y = n
l.p = f
l.o = i
g.y = n
a.s = k
a.t = j
assert l.u.r.q.o.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: A = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: B = None
        self.x: B = None
        self.txt = txt

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

j = A("j")
i = B("i")
k = C("k")
f = D("f")
n = E("n")
l = F("l")
g = C("g")
a = A("a")

j.s = k
j.t = a
i.p = f
i.q = l
k.y = n
f.w = g
f.o = l
f.q = k
n.o = k
n.r = i
n.x = i
l.u = n
l.y = n
l.p = f
l.o = i
g.y = n
a.s = k
a.t = j
assert l.u.r.q.o.p.q.txt == "k"