class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: B = None
        self.y: G = None
        self.w: H = None
        self.o: D = None
        self.r: F = None
        self.q: D = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: F = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: G = None
        self.s: A = None
        self.q: C = None
        self.r: G = None
        self.z: C = None
        self.x: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: F = None
        self.v: C = None
        self.s: B = None
        self.p: A = None
        self.q: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: A = None
        self.r: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: F = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: G = None
        self.s: A = None
        self.q: C = None
        self.r: G = None
        self.z: C = None
        self.x: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: F = None
        self.v: C = None
        self.s: B = None
        self.p: A = None
        self.q: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: A = None
        self.r: B = None
        self.txt = txt

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

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