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

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

class C:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: F = None
        self.q: A = None
        self.s: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: F = None
        self.o: F = None
        self.s: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: F = None
        self.q: A = None
        self.s: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: F = None
        self.o: F = None
        self.s: F = None
        self.txt = txt

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

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