class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: D = None
        self.u: C = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: F = None
        self.t: B = None
        self.u: E = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: F = None
        self.t: B = None
        self.u: E = None
        self.y: E = None
        self.txt = txt

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

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

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

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

j.s = n
j.q = b
j.u = a
j.p = g
g.y = b
g.s = i
g.x = i
g.r = i
g.p = j
g.u = m
a.q = e
b.p = n
b.o = m
b.t = g
b.u = i
b.y = i
i.t = n
i.x = b
i.y = l
m.z = a
m.o = e
m.p = n
l.x = n
l.p = n
l.s = b
l.u = b
l.q = m
l.o = g
n.z = a
n.o = l
n.p = m
e.x = n
e.p = n
e.s = b
e.u = b
e.q = m
e.o = g
f.x = m
f.s = b
f.u = b
f.q = n
f.p = n
f.o = g
assert g.u.o.o.txt == "g"