class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: F = None
        self.s: F = None
        self.x: D = None
        self.q: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: A = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: A = None
        self.w: A = None
        self.txt = txt

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

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