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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: G = None
        self.p: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: D = None
        self.v: B = None
        self.z: E = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: B = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: G = None
        self.p: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: D = None
        self.v: B = None
        self.z: E = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: B = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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