class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: C = None
        self.z: C = None
        self.t: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: D = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: A = None
        self.txt = txt

a = A("a")
i = B("i")
m = C("m")
b = D("b")
e = E("e")
l = F("l")
f = G("f")
n = C("n")
h = E("h")
c = D("c")

a.r = b
a.p = m
a.z = m
a.t = l
i.r = b
i.p = l
m.z = e
m.q = i
m.w = i
m.y = n
m.s = a
b.o = l
e.p = h
e.y = h
e.q = h
e.x = b
e.s = b
e.w = b
l.y = i
l.r = i
l.x = b
f.r = c
f.z = a
n.z = e
n.q = i
n.w = i
n.y = m
n.s = a
h.p = e
h.y = e
h.q = e
h.x = c
h.s = c
h.w = c
c.o = l
assert a.r.o.x.o.x.o.r.p.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: C = None
        self.z: C = None
        self.t: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: D = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: A = None
        self.txt = txt

a = A("a")
i = B("i")
m = C("m")
b = D("b")
e = E("e")
l = F("l")
f = G("f")
n = C("n")
h = E("h")
c = D("c")

a.r = b
a.p = m
a.z = m
a.t = l
i.r = b
i.p = l
m.z = e
m.q = i
m.w = i
m.y = n
m.s = a
b.o = l
e.p = h
e.y = h
e.q = h
e.x = b
e.s = b
e.w = b
l.y = i
l.r = i
l.x = b
f.r = c
f.z = a
n.z = e
n.q = i
n.w = i
n.y = m
n.s = a
h.p = e
h.y = e
h.q = e
h.x = c
h.s = c
h.w = c
c.o = l
assert a.r.o.x.o.x.o.r.p.txt == "l"