class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: C = None
        self.v: F = None
        self.x: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: B = None
        self.y: B = None
        self.txt = txt

j = A("j")
m = B("m")
g = C("g")
k = D("k")
a = E("a")
e = F("e")
h = C("h")

j.t = g
j.y = g
j.v = e
j.x = k
m.v = a
m.o = j
m.y = k
g.q = a
g.s = a
g.u = e
g.z = e
g.p = k
g.y = m
k.y = a
a.w = g
a.x = m
e.w = g
e.p = m
e.y = m
h.q = a
h.s = a
h.u = e
h.z = e
h.p = k
h.y = m
assert m.v.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: C = None
        self.v: F = None
        self.x: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: B = None
        self.y: B = None
        self.txt = txt

j = A("j")
m = B("m")
g = C("g")
k = D("k")
a = E("a")
e = F("e")
h = C("h")

j.t = g
j.y = g
j.v = e
j.x = k
m.v = a
m.o = j
m.y = k
g.q = a
g.s = a
g.u = e
g.z = e
g.p = k
g.y = m
k.y = a
a.w = g
a.x = m
e.w = g
e.p = m
e.y = m
h.q = a
h.s = a
h.u = e
h.z = e
h.p = k
h.y = m
assert m.v.w.z.txt == "e"