class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: D = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: A = None
        self.q: F = None
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: B = None
        self.z: F = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: A = None
        self.q: F = None
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: B = None
        self.z: F = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: E = None
        self.txt = txt

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

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