class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: C = None
        self.w: C = None
        self.p: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: A = None
        self.w: B = None
        self.y: A = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: G = None
        self.o: D = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: C = None
        self.t: B = None
        self.p: C = None
        self.u: B = None
        self.s: A = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: A = None
        self.w: B = None
        self.y: A = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: G = None
        self.o: D = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: C = None
        self.t: B = None
        self.p: C = None
        self.u: B = None
        self.s: A = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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