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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: B = None
        self.p: D = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

m.q = g
d.v = k
d.o = j
d.p = i
d.x = m
b.x = h
b.o = h
b.y = m
b.w = d
b.p = k
b.u = n
i.q = n
i.p = n
i.y = k
i.r = k
i.s = m
i.w = g
n.q = i
n.w = i
n.r = m
n.y = k
n.s = k
n.o = j
k.s = j
h.x = b
h.o = b
h.y = m
h.w = g
h.p = k
h.u = n
j.v = k
j.o = d
j.p = i
j.x = m
g.v = k
g.o = d
g.p = i
g.x = m
assert k.s.x.q.x.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: B = None
        self.p: D = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

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