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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: B = None
        self.s: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: B = None
        self.u: E = None
        self.o: C = None
        self.txt = txt

g = A("g")
j = B("j")
h = C("h")
e = D("e")
c = E("c")
m = F("m")
f = E("f")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: B = None
        self.s: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: B = None
        self.u: E = None
        self.o: C = None
        self.txt = txt

g = A("g")
j = B("j")
h = C("h")
e = D("e")
c = E("c")
m = F("m")
f = E("f")

g.w = m
g.o = h
j.r = e
j.x = h
h.p = m
h.x = e
e.t = c
e.q = c
e.v = c
e.z = h
c.v = g
c.p = j
c.s = f
m.p = g
m.s = j
m.u = c
m.o = h
f.v = g
f.p = j
f.s = c
assert j.r.v.v.w.o.x.txt == "e"