class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: E = None
        self.q: E = None
        self.w: G = None
        self.y: D = None
        self.v: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.z: E = None
        self.y: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: A = None
        self.v: B = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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

b.u = f
b.x = g
b.q = n
b.w = a
b.y = h
b.v = i
f.x = n
d.x = k
d.u = c
d.t = h
h.v = n
h.t = d
n.w = c
n.z = g
n.y = i
k.y = a
k.q = a
k.r = b
k.v = f
a.w = b
i.t = a
i.y = a
c.r = h
c.u = d
g.w = c
g.z = n
g.y = i
assert f.x.y.y.w.u.x.y.y.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: E = None
        self.q: E = None
        self.w: G = None
        self.y: D = None
        self.v: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.z: E = None
        self.y: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: A = None
        self.v: B = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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

b.u = f
b.x = g
b.q = n
b.w = a
b.y = h
b.v = i
f.x = n
d.x = k
d.u = c
d.t = h
h.v = n
h.t = d
n.w = c
n.z = g
n.y = i
k.y = a
k.q = a
k.r = b
k.v = f
a.w = b
i.t = a
i.y = a
c.r = h
c.u = d
g.w = c
g.z = n
g.y = i
assert f.x.y.y.w.u.x.y.y.w.x.txt == "g"