class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: F = None
        self.p: I = None
        self.s: F = None
        self.r: C = None
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: C = None
        self.w: H = None
        self.r: D = None
        self.p: D = None
        self.s: B = None
        self.q: D = None
        self.x: D = None
        self.t: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: D = None
        self.s: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: B = None
        self.txt = txt

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

b = A("b")
n = B("n")
h = C("h")
l = D("l")
a = E("a")
g = F("g")
e = G("e")
d = H("d")
i = I("i")

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: C = None
        self.w: H = None
        self.r: D = None
        self.p: D = None
        self.s: B = None
        self.q: D = None
        self.x: D = None
        self.t: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: D = None
        self.s: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: B = None
        self.txt = txt

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

b = A("b")
n = B("n")
h = C("h")
l = D("l")
a = E("a")
g = F("g")
e = G("e")
d = H("d")
i = I("i")

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