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

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

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

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

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

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

b = A("b")
i = B("i")
h = C("h")
d = D("d")
c = E("c")
e = F("e")
l = D("l")

b.p = e
b.r = e
b.z = e
b.u = c
b.v = i
i.r = e
i.w = d
i.q = b
i.s = b
h.q = c
h.p = c
h.r = i
h.v = l
d.p = c
d.q = i
d.t = b
d.w = e
d.r = l
c.r = h
c.w = h
e.v = i
l.p = c
l.q = i
l.t = b
l.w = e
l.r = d
assert i.r.v.w.t.z.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: F = None
        self.u: E = None
        self.v: B = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

b = A("b")
i = B("i")
h = C("h")
d = D("d")
c = E("c")
e = F("e")
l = D("l")

b.p = e
b.r = e
b.z = e
b.u = c
b.v = i
i.r = e
i.w = d
i.q = b
i.s = b
h.q = c
h.p = c
h.r = i
h.v = l
d.p = c
d.q = i
d.t = b
d.w = e
d.r = l
c.r = h
c.w = h
e.v = i
l.p = c
l.q = i
l.t = b
l.w = e
l.r = d
assert i.r.v.w.t.z.v.w.txt == "d"