class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: G = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: B = None
        self.u: D = None
        self.y: D = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: G = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: B = None
        self.u: D = None
        self.y: D = None
        self.v: A = None
        self.txt = txt

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

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

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