class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: A = None
        self.z: D = None
        self.s: E = None
        self.r: G = None
        self.t: C = None
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: C = None
        self.z: E = None
        self.o: C = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: A = None
        self.t: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: D = None
        self.w: F = None
        self.q: A = None
        self.v: F = None
        self.y: C = None
        self.z: F = None
        self.txt = txt

g = A("g")
a = B("a")
j = C("j")
k = D("k")
c = E("c")
l = F("l")
d = G("d")
h = A("h")

g.q = l
g.v = h
g.z = k
g.s = c
g.r = d
g.x = d
g.t = j
a.q = j
a.x = j
a.o = j
a.z = c
a.p = h
j.s = l
j.x = h
j.t = c
k.o = g
c.r = l
l.q = g
l.o = c
d.s = g
d.x = k
d.w = l
d.v = l
d.z = l
d.q = h
d.y = j
h.q = l
h.v = g
h.z = k
h.s = c
h.r = d
h.x = d
h.t = j
assert l.o.r.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: A = None
        self.z: D = None
        self.s: E = None
        self.r: G = None
        self.t: C = None
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: C = None
        self.z: E = None
        self.o: C = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: A = None
        self.t: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: D = None
        self.w: F = None
        self.q: A = None
        self.v: F = None
        self.y: C = None
        self.z: F = None
        self.txt = txt

g = A("g")
a = B("a")
j = C("j")
k = D("k")
c = E("c")
l = F("l")
d = G("d")
h = A("h")

g.q = l
g.v = h
g.z = k
g.s = c
g.r = d
g.x = d
g.t = j
a.q = j
a.x = j
a.o = j
a.z = c
a.p = h
j.s = l
j.x = h
j.t = c
k.o = g
c.r = l
l.q = g
l.o = c
d.s = g
d.x = k
d.w = l
d.v = l
d.z = l
d.q = h
d.y = j
h.q = l
h.v = g
h.z = k
h.s = c
h.r = d
h.x = d
h.t = j
assert l.o.r.o.r.txt == "l"