class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: A = None
        self.p: G = None
        self.y: A = None
        self.u: A = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: G = None
        self.v: E = None
        self.r: G = None
        self.x: E = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: C = None
        self.u: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: G = None
        self.v: E = None
        self.r: G = None
        self.x: E = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: C = None
        self.u: E = None
        self.txt = txt

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

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