class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: B = None
        self.o: B = None
        self.t: D = None
        self.v: C = None
        self.y: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: E = None
        self.r: C = None
        self.u: C = None
        self.t: D = None
        self.q: F = None
        self.p: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: B = None
        self.z: E = None
        self.q: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: E = None
        self.r: C = None
        self.u: C = None
        self.t: D = None
        self.q: F = None
        self.p: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: B = None
        self.z: E = None
        self.q: C = None
        self.txt = txt

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

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

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