class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: B = None
        self.z: H = None
        self.p: D = None
        self.q: B = None
        self.v: B = None
        self.s: H = None
        self.r: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: D = None
        self.r: B = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: H = None
        self.u: A = None
        self.v: G = None
        self.y: C = None
        self.r: G = None
        self.t: B = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: B = None
        self.o: F = None
        self.u: D = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: D = None
        self.r: B = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: H = None
        self.u: A = None
        self.v: G = None
        self.y: C = None
        self.r: G = None
        self.t: B = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: B = None
        self.o: F = None
        self.u: D = None
        self.s: B = None
        self.txt = txt

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

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