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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.s: A = None
        self.p: D = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: D = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.s: A = None
        self.p: D = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: D = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: B = None
        self.txt = txt

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

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