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

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

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

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

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

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

g = A("g")
b = B("b")
f = C("f")
m = D("m")
l = E("l")
i = F("i")
d = B("d")
j = F("j")

g.s = b
g.r = m
g.y = f
b.x = l
b.q = g
b.z = g
f.w = i
f.o = i
f.x = g
f.p = g
f.s = b
f.q = l
m.o = g
m.s = g
m.y = l
m.r = d
l.q = g
l.r = f
l.s = f
l.p = j
l.o = j
l.u = b
i.t = m
i.w = f
i.v = d
d.x = l
d.q = g
d.z = g
j.t = m
j.w = f
j.v = d
assert f.w.t.y.r.s.x.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: D = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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

g = A("g")
b = B("b")
f = C("f")
m = D("m")
l = E("l")
i = F("i")
d = B("d")
j = F("j")

g.s = b
g.r = m
g.y = f
b.x = l
b.q = g
b.z = g
f.w = i
f.o = i
f.x = g
f.p = g
f.s = b
f.q = l
m.o = g
m.s = g
m.y = l
m.r = d
l.q = g
l.r = f
l.s = f
l.p = j
l.o = j
l.u = b
i.t = m
i.w = f
i.v = d
d.x = l
d.q = g
d.z = g
j.t = m
j.w = f
j.v = d
assert f.w.t.y.r.s.x.u.q.txt == "g"