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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: D = None
        self.r: B = None
        self.y: E = None
        self.v: E = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: A = None
        self.s: F = None
        self.y: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: D = None
        self.v: A = None
        self.w: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: D = None
        self.r: B = None
        self.y: E = None
        self.v: E = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: A = None
        self.s: F = None
        self.y: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: D = None
        self.v: A = None
        self.w: B = None
        self.txt = txt

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

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