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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: A = None
        self.z: C = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

g.w = k
g.y = b
g.o = j
m.v = h
m.q = g
m.z = j
m.x = b
j.q = l
b.u = d
l.q = d
l.o = m
l.s = b
k.y = d
k.r = n
n.y = d
n.r = k
a.w = n
a.y = b
a.o = j
h.u = d
d.q = l
d.o = m
d.s = h
assert n.y.o.z.q.s.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: D = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: A = None
        self.z: C = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

g.w = k
g.y = b
g.o = j
m.v = h
m.q = g
m.z = j
m.x = b
j.q = l
b.u = d
l.q = d
l.o = m
l.s = b
k.y = d
k.r = n
n.y = d
n.r = k
a.w = n
a.y = b
a.o = j
h.u = d
d.q = l
d.o = m
d.s = h
assert n.y.o.z.q.s.u.q.txt == "l"