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

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: C = None
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: B = None
        self.s: E = None
        self.t: B = None
        self.txt = txt

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

k.v = c
k.y = f
k.r = h
k.u = i
c.w = e
c.u = m
i.q = c
i.w = h
i.v = m
d.z = c
m.r = e
m.t = a
m.u = c
e.r = c
e.q = c
e.t = c
e.s = m
a.q = c
a.w = h
a.v = m
h.q = c
h.w = a
h.v = m
f.z = c
b.v = c
b.y = f
b.r = i
b.u = h
assert a.q.u.r.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: D = None
        self.r: C = None
        self.u: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: C = None
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: B = None
        self.s: E = None
        self.t: B = None
        self.txt = txt

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

k.v = c
k.y = f
k.r = h
k.u = i
c.w = e
c.u = m
i.q = c
i.w = h
i.v = m
d.z = c
m.r = e
m.t = a
m.u = c
e.r = c
e.q = c
e.t = c
e.s = m
a.q = c
a.w = h
a.v = m
h.q = c
h.w = a
h.v = m
f.z = c
b.v = c
b.y = f
b.r = i
b.u = h
assert a.q.u.r.r.w.txt == "e"