class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: D = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: C = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

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

d = A("d")
l = B("l")
b = C("b")
g = D("g")
c = E("c")
a = F("a")
j = G("j")
m = A("m")
n = G("n")

d.u = a
d.z = a
d.w = g
l.r = b
l.w = b
l.z = c
b.z = c
g.q = b
g.o = a
g.y = c
c.w = l
c.q = a
c.o = g
c.s = d
c.p = m
a.w = c
a.z = b
a.s = d
j.v = l
j.y = a
j.u = a
j.t = d
j.o = d
j.w = m
j.q = g
m.u = a
m.z = a
m.w = g
n.v = l
n.y = a
n.u = a
n.t = m
n.o = m
n.w = d
n.q = g
assert l.z.w.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: D = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: C = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

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

d = A("d")
l = B("l")
b = C("b")
g = D("g")
c = E("c")
a = F("a")
j = G("j")
m = A("m")
n = G("n")

d.u = a
d.z = a
d.w = g
l.r = b
l.w = b
l.z = c
b.z = c
g.q = b
g.o = a
g.y = c
c.w = l
c.q = a
c.o = g
c.s = d
c.p = m
a.w = c
a.z = b
a.s = d
j.v = l
j.y = a
j.u = a
j.t = d
j.o = d
j.w = m
j.q = g
m.u = a
m.z = a
m.w = g
n.v = l
n.y = a
n.u = a
n.t = m
n.o = m
n.w = d
n.q = g
assert l.z.w.z.o.txt == "g"