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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: C = None
        self.u: D = None
        self.v: D = None
        self.t: B = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: A = None
        self.t: E = None
        self.txt = txt

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

i.x = m
i.y = l
i.w = l
i.z = j
i.p = g
j.z = c
g.o = h
g.x = h
g.q = k
d.o = g
l.q = d
l.w = m
l.t = i
m.x = g
m.w = g
m.u = k
m.v = k
m.t = b
m.q = d
h.x = b
h.z = c
h.t = l
k.o = g
c.x = m
c.y = l
c.w = l
c.z = j
c.p = g
b.z = c
assert g.o.x.z.x.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: E = None
        self.z: B = None
        self.w: E = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: C = None
        self.u: D = None
        self.v: D = None
        self.t: B = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: A = None
        self.t: E = None
        self.txt = txt

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

i.x = m
i.y = l
i.w = l
i.z = j
i.p = g
j.z = c
g.o = h
g.x = h
g.q = k
d.o = g
l.q = d
l.w = m
l.t = i
m.x = g
m.w = g
m.u = k
m.v = k
m.t = b
m.q = d
h.x = b
h.z = c
h.t = l
k.o = g
c.x = m
c.y = l
c.w = l
c.z = j
c.p = g
b.z = c
assert g.o.x.z.x.q.o.txt == "g"