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

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

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: F = None
        self.q: D = None
        self.w: D = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: E = None
        self.s: E = None
        self.v: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: F = None
        self.q: D = None
        self.w: D = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: E = None
        self.s: E = None
        self.v: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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