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

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

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

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

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

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

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

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

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

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

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

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

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

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

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