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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: D = None
        self.t: A = None
        self.p: F = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: E = None
        self.q: A = None
        self.t: A = None
        self.y: D = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: D = None
        self.t: A = None
        self.p: F = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: E = None
        self.q: A = None
        self.t: A = None
        self.y: D = None
        self.v: E = None
        self.txt = txt

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

d.r = l
c.z = g
c.o = j
c.v = e
c.w = l
e.u = g
e.o = g
g.q = l
m.x = g
m.r = g
m.y = g
m.t = i
m.p = j
j.x = g
j.y = g
j.p = h
j.v = h
j.q = d
j.t = i
i.r = c
h.x = g
h.r = g
h.y = g
h.t = d
h.p = j
l.z = g
l.o = j
l.v = e
l.w = c
assert m.t.r.v.o.q.z.q.z.q.txt == "l"