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

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: B = None
        self.p: G = None
        self.v: E = None
        self.s: F = None
        self.u: B = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: H = None
        self.r: E = None
        self.y: E = None
        self.s: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: B = None
        self.p: G = None
        self.v: E = None
        self.s: F = None
        self.u: B = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: H = None
        self.r: E = None
        self.y: E = None
        self.s: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: B = None
        self.txt = txt

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

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