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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: B = None
        self.p: D = None
        self.t: F = None
        self.u: C = None
        self.z: D = None
        self.txt = txt

b = A("b")
d = B("d")
f = C("f")
i = D("i")
m = E("m")
g = F("g")
k = G("k")
j = H("j")

b.q = k
d.x = j
f.w = k
f.v = g
i.o = m
m.y = i
m.t = i
m.r = k
m.p = k
m.q = j
m.u = d
m.o = g
m.w = f
g.v = f
k.o = d
k.t = f
k.z = f
k.v = j
k.y = i
k.p = b
j.o = k
j.v = d
j.p = i
j.z = i
j.t = g
j.u = f
assert d.x.v.x.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: B = None
        self.p: D = None
        self.t: F = None
        self.u: C = None
        self.z: D = None
        self.txt = txt

b = A("b")
d = B("d")
f = C("f")
i = D("i")
m = E("m")
g = F("g")
k = G("k")
j = H("j")

b.q = k
d.x = j
f.w = k
f.v = g
i.o = m
m.y = i
m.t = i
m.r = k
m.p = k
m.q = j
m.u = d
m.o = g
m.w = f
g.v = f
k.o = d
k.t = f
k.z = f
k.v = j
k.y = i
k.p = b
j.o = k
j.v = d
j.p = i
j.z = i
j.t = g
j.u = f
assert d.x.v.x.z.o.txt == "m"