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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: F = None
        self.q: F = None
        self.o: B = None
        self.x: D = None
        self.txt = txt

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

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

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

f = A("f")
b = B("b")
l = C("l")
h = D("h")
i = E("i")
a = F("a")
j = D("j")
d = B("d")

f.w = a
f.q = a
b.v = i
b.r = i
b.u = l
b.q = a
b.o = j
l.y = a
l.s = a
l.q = a
l.o = d
l.x = h
h.y = f
h.x = f
h.q = f
i.w = h
i.x = l
i.o = f
i.z = f
a.u = b
a.r = d
a.v = l
j.y = f
j.x = f
j.q = f
d.v = i
d.r = i
d.u = l
d.q = a
d.o = h
assert j.y.q.r.r.o.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: F = None
        self.q: F = None
        self.o: B = None
        self.x: D = None
        self.txt = txt

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

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

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

f = A("f")
b = B("b")
l = C("l")
h = D("h")
i = E("i")
a = F("a")
j = D("j")
d = B("d")

f.w = a
f.q = a
b.v = i
b.r = i
b.u = l
b.q = a
b.o = j
l.y = a
l.s = a
l.q = a
l.o = d
l.x = h
h.y = f
h.x = f
h.q = f
i.w = h
i.x = l
i.o = f
i.z = f
a.u = b
a.r = d
a.v = l
j.y = f
j.x = f
j.q = f
d.v = i
d.r = i
d.u = l
d.q = a
d.o = h
assert j.y.q.r.r.o.w.r.txt == "d"